#import "ButterflyQuestController.h"
        
#import "ButterflyQuestModel.h"
#import "ButterflyQuestCell.h"
#import "Masonry.h"

@interface ButterflyQuestController () <UITableViewDataSource, UITableViewDelegate>

@property (nonatomic, strong) UITableView *tonicTableView;
@property (nonatomic, strong) NSMutableArray *wandererZenithCuriosityDatas;

@end

@implementation ButterflyQuestController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self graciousInitui];
	[self binarygetData];
}


//: 初始化页面UI
- (void)graciousInitui {

	[self.view addSubview:self.tonicTableView];
	[self.tonicTableView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.leading.trailing.equalTo(self.view);
		make.top.equalTo(self.view);
		make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom);
	}];
}


- (UITableView *)figHandleTableView {
    if (!_tonicTableView) {
        _tonicTableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
        _tonicTableView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
        _tonicTableView.estimatedRowHeight = 0;
        _tonicTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        _tonicTableView.contentInset = UIEdgeInsetsMake(16, 0, 16, 0);
        _tonicTableView.delegate = self;
        _tonicTableView.dataSource = self;
        _tonicTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
        _tonicTableView.showsVerticalScrollIndicator = NO;
        _tonicTableView.showsHorizontalScrollIndicator = NO;
        _tonicTableView.backgroundColor = UIColor.clearColor;
    }
    return _tonicTableView;
}

//: 懒加载数据模型数组
- (NSMutableArray *)wandererZenithCuriosityDatas {
	if (!_wandererZenithCuriosityDatas) {
		_wandererZenithCuriosityDatas = [NSMutableArray array];
	}
	return _wandererZenithCuriosityDatas;
}

//: 获取数据模型
- (void)binarygetData {
	
}

#pragma mark - UITableView DataSource 
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.wandererZenithCuriosityDatas.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    ButterflyQuestCell *archive = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([ButterflyQuestCell class])];
    if (archive == nil) {
        archive = [[ButterflyQuestCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:NSStringFromClass([ButterflyQuestCell class])];
    }
    archive.selectionStyle = UITableViewCellSelectionStyleNone;
    
    return archive;
}


#pragma mark - UITableView Delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // cell tap action
}


@end
